﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace StorageInterface.Reports
{
    /// <summary>
    /// Interaction logic for Buyers.xaml
    /// </summary>
    public partial class Buyers : UserControl
    {
        public Buyers()
        {
            InitializeComponent();
            Update();
        }

        public void Update()
        {
            bcombo.Items.Clear();
            bcombo.Items.Add("Все покупатели");
            var els = Data.GetAllPartners();
            foreach (var el in els)
                bcombo.Items.Add(el);
            bcombo.SelectedIndex = 0;
        }

        private void Button_Click(object sender, RoutedEventArgs e)
        {
           
            dg.ItemsSource = Data.GetOrders(dp1.SelectedDate, dp2.SelectedDate, bcombo.SelectedItem as Partner);
        }
    }
}
